code data improvements and code refactoring