Entry database restructure and code refactoring