can you extract this to another file ? does it make any sense to use an inner class?