refactorings to help the king project