Edited database & refactoring