More complexity reduction
Additional unit tests for extracted functions