refactoring: got rid of unnecessary middle conversion