Extracting helpers and server methods into modules

both for complexity reasons and so that RuboCop can properly analyze the
methods.