Remove unused code and add port configuration