[WIP] Extract some methods to utility functions