refactor: indentation and cleanup code