Feature updates and code refactoring