Refactor: code cleanup