Close #24: Address code complexity issues