main: move player related functionality to a separate component