Refactor & Database Handling