reduced lines of code. separated methods