reduce function call overheads
improve code reuse