Performance optimization and code refactoring - TechinUK