Refactor code, make proper Object class