master: further separation of code