Refactor: Inline setup287code and related functions